package com.rem.concurrency.juc.my13Single;

/**
 * 饿汉式
 * 静态内部类单例
 *
 * @author Rem
 * @date 2021-03-11
 */

public class Holder {

    private Holder() {
        System.err.println(Thread.currentThread().getName() + "ok");
    }

    public static Holder getInstance() {
        return InnerClass.HOLDER;
    }


    private static class InnerClass {
        private static final Holder HOLDER = new Holder();
    }
}
